package com.example.webbasic.coprop;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试接口
 * @author ben
 * @date 2021-11-13 22:05:42 CST
 */
@RestController
@RequestMapping(value="/coprop/test")
public class CopropTestController {

	// 非必须，没有配置的时候，值为null
	@Autowired(required = false)
	private CopropTestConfig copropTestConfig;
	
	@GetMapping("/getConfigF1")
	public String getConfigF1() {
		System.out.println("copropTestConfig=" + copropTestConfig);
		if (copropTestConfig == null) {
			return "warning: not configed!";
		} else {
			return copropTestConfig.getF1();
		}
	}
	
}
